package com.dq.repository.record;

import com.dq.domain.activity.Activity;
import com.dq.domain.activity.ActivityRecord;
import com.dq.domain.sys.user.user.base.SysUser;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

/**
 * @Author luchangtong
 * @Date 2019/11/23 11:37
 */
@Repository
public interface ActivityRecordRepository extends JpaRepository<ActivityRecord, Long> {
    Page<ActivityRecord> findBySysUserAndDeletedFalseOrderByCreateTimeDesc(SysUser sysUser, Pageable pageable);
    Long countBySysUserAndDeletedFalse(SysUser sysUser);

    ActivityRecord findBySysUserAndActivityAndDeletedFalse(SysUser sysUser, Activity activity);
}
